package top.huhuiyu.springboot3.controller.user;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import top.huhuiyu.springboot3.base.R;
import top.huhuiyu.springboot3.service.AuthService;
import top.huhuiyu.springboot3.vo.AuthUser;
import top.huhuiyu.springboot3.vo.UserPwd;

@RestController
@RequiredArgsConstructor
@RequestMapping("/user")
public class UserController {
    private final AuthService authService;

    @PostMapping("")
    public R<String> reg(@RequestBody AuthUser user) {
        return authService.reg(user);
    }

    @PatchMapping("")
    public R<String> changePwd(@RequestBody UserPwd user) {
        return authService.changePwd(user);
    }

}
